package com.atguigu.gmall.product.mapper;

import com.atguigu.gmall.product.model.BaseTrademark;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 品牌表 Mapper 接口
 *
 * @author lhw
 * @since 2022-12-25
 */
@Repository
public interface BaseTrademarkMapper extends BaseMapper<BaseTrademark> {
    @Select("select bt.* from gmall_product.base_trademark bt where bt.id not in (select bct.trademark_id from gmall_product.base_category_trademark bct where bct.category3_id = #{category3Id}) and bt.is_deleted = 0;")
    List<BaseTrademark> findCurrentTrademarkList(@Param("category3Id") Long category3Id);
}
